------------------ fgui require start ------------------
------------------  fgui require end  ------------------
local GuildLogItemSkin = Class("GuildLogItemSkin");

function GuildLogItemSkin:ctor(com)
    ------------------ fgui事件绑定start ------------------
    self:bindChild(com);
    self.list_Logdetails.onClickItem:Add(self.onClickItem_List_Logdetails,self);
    self.list_Logdetails.itemRenderer = function(index,obj) self:onRender_List_LogdetailsItem(index,obj); end;
    self:init();
    ------------------  fgui事件绑定end  ------------------
end

function GuildLogItemSkin:bindChild(com)
    ------------------ fgui变量绑定start ------------------
    self.fguiObj = com;
    self.text_journal = com:GetChild("Text_journal");
    self.list_Logdetails = com:GetChild("List_Logdetails");
    ------------------  fgui变量绑定end  ------------------
end

function GuildLogItemSkin:init()
    self.data = nil;
end

function GuildLogItemSkin:OnDestroy()
    ------------------ fgui事件移除start ------------------
    self:beforeDestroy();
    self.list_Logdetails.onClickItem:Clear();
    self.list_Logdetails.itemRenderer = nil;
    ------------------  fgui事件移除end  ------------------
end

function GuildLogItemSkin:onClickItem_List_Logdetails(context) end

function GuildLogItemSkin:onRender_List_LogdetailsItem(index,obj) 
    obj:GetChild("title").text = self.data.msgs[index+1];
end

function GuildLogItemSkin:onRender(data)
    self.data = data;
    self.text_journal.text = data.time;
    self.list_Logdetails.numItems = #data.msgs;
    self.list_Logdetails:ResizeToFit();
end

------------------  ↑ fgui事件句柄 ↑  ------------------

function GuildLogItemSkin:beforeDestroy() end

return GuildLogItemSkin;
